package day03.Standard_Homework;

public class Homework_Confromation {
    public static void main(String[] args) {
        System.out.println(6 % 3);  //输出结果为0----整除

        System.out.println(5 % 3);  //输出结果为2

        int a = 5, b = 10;
        a++;
        --b;
        System.out.println(a);  //输出结果为6
        System.out.println(b);  //输出结果为9

        int c = 3, d = 6;
        --c;
        ++d;
        System.out.println(c);  //输出结果为2
        System.out.println(d);  //输出结果为7

        int e = 8, f = 5;
        int g = ++e;
        int h = f--;
        System.out.println(g);  //输出结果为9
        System.out.println(h);  //输出结果为5

        int a1 = 12, b1 = 16;
        int c1 = a1++ + --b1;
        int d1 = ++b1 + --a1;
        System.out.println(c1); //输出结果为27
        System.out.println(d1); //输出结果为28

        int a2 = 8, b2 = 10;
        System.out.println(a2 >= b2);    //输出结果为false

        int c2 = 15;
        int d2 = 15;
        System.out.println(c2 == d2);

        int a3 = 15, b3 = 10;
        System.out.println(a3 % b3 == 5);

        int c3 = 15, d3 = 5;
        System.out.println(c3 / d3 != 3);   //输出结果为false

        System.out.println();

        //第一遍:
        int a4 = 10, b4 = 15, c4 = 10;
        boolean b11 = a4 == c4 && b4 != c4;
        System.out.println(b11);  //输出结果为true

        System.out.println();

        int a5 = 20, b5 = 18, c5 = 25;
        boolean b12 = (a5 / b5 == 1) || (c5 % b5 != 7);
        System.out.println(b12);    //输出结果为true

        System.out.println();

        int a6 = 8, b6 = 9, c6 = 18;
        boolean b13 = (c6 / b6 != 2) && (b6 % a6 == 1);
        System.out.println(b13);    //输出结果为false----发生了短路效应

        System.out.println();

        int a7= 12, b7 = 22, c7 = 34;
        boolean b14 = (b7 - a7 == 10) || (c7 / b7 == 2);
        System.out.println(b14);    //输出结果为true----发生了短路效应

        System.out.println();

        int a8 = 10;
        a8 += 5;
        System.out.println(a8); //输出结果为15

        System.out.println();

        int b8 = 25;
        b8 *= 4;
        System.out.println(b8); //输出结果为100

        System.out.println();

        short s1 = 20;
        s1 += 10;
        System.out.println(s1); //输出结果为30

        System.out.println();

        short s2 = 25;
        s2 += 10;
        System.out.println(s2); //输出结果为35

        System.out.println();
        int age1 = 20;
        String name1 = "Hongyi";
        System.out.println(age1 + name1);   //输出结果为"20Hongyi"

        System.out.println();

        int age2 = 25;
        String name2 = "Devon";
        String birth1 = "October/23/2024";
        System.out.println(age2 + name2 + birth1);

        System.out.println();

        int num1 = 5, num2 = 5;
        int flag = num1 == num2 ? 1 : -1;
        System.out.println(flag);   //输出结果为1

        System.out.println();

        int num3 = 4, num4 = 5;
        int flag1 = num4 > num3 ? 5 : 4;
        System.out.println(flag1);   //输出结果为5

        System.out.println();

        double price1 = 550.0;
        if (price1 >= 500) {
            price1 *= 0.8;
        }
        System.out.println(price1); //输出结果为440.0

        System.out.println();

        double price2 = 600.0;
        if (price2 >= 500) {
            price2 *= 0.8;
        } else {
            price2 *= 0.9;
        }
        System.out.println(price2); //输出结果为480.0

        System.out.println();

        int score2 = 99;
        if ((score2 >= 0) && (score2 <= 100)) {
            System.out.println(score2 + "为合法成绩");
        } else {
            System.out.println(score2 + "为不合法成绩");  //输出结果为99为合法成
        }

        System.out.println();

        double price3 = 5000.0;
        if (price3 >= 2000) {
            price3 *= 0.5;
        } else if (price3 >= 1000) {
            price3 *= 0.7;
        } else if (price3 >= 500) {
            price3 *= 0.8;
        } else {
            price3 *= 0.9;
        }
        System.out.println(price3); //输出结果为2500.0
    }
}
